import React, { Component } from 'react'
import Son from './Son'
// 获取context数据的第二种方式:
// 1. 引入context
import context from './context'
export default class Far extends Component {
  // 2. 给需要接收context数据的组件,添加静态属性contextType
  static contextType = context
  render() {
    return (
      <div>
        {/* this.context就可以获取到传递的数据 */}
        Far,{this.context}
        <hr />
        <Son></Son>
      </div>
    )
  }
}
